/*
 *  $Id: Ability.cs 975 2009-12-16 17:13:22Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Affects {
    /// <summary>
    /// Эффект: способность
    /// Дает определенную дополнительную способность.
    /// </summary>
    public class AbilityAffect: Affect {
        public readonly AbilityCard Ability;

        public AbilityAffect(AbilityCard ability) {
            Ability = ability;
        }

        public override string Id {
            get { return "ability"; }
        }
        public override string NameText {
            get { return Name.GetText(Ability); }
        }

        public override ElementType Element {
            get { return Ability.Element; }
        }
        public override Languages.Phrase Description {
            get { return Ability.Description; }
        }
        public override string DescriptionText {
            get { return Ability.DescriptionText; }
        }

        public override int BaseWeight {
            get { return Ability.Weight; }
        }

        public override Affect Clone() {
            return new AbilityAffect(Ability);
        }

        public override void SetAffect() {
            base.SetAffect();
            LocalSummary.AddAbility(Ability);
        }
        public override void ResetAffect() {
            base.ResetAffect();
            LocalSummary.RemoveAbility(Ability);
        }
    }
}